{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Title: #Number of Senior Citizens"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Difficulty: #Easy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Category Title: #Algorithms"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Tag Slug: #array #string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Name Translated: #数组 #字符串"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solution Name: countSeniors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Title: #老人的数目"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Content:\n",
    "<p>给你一个下标从 <strong>0</strong>&nbsp;开始的字符串&nbsp;<code>details</code>&nbsp;。<code>details</code>&nbsp;中每个元素都是一位乘客的信息，信息用长度为 <code>15</code>&nbsp;的字符串表示，表示方式如下：</p>\n",
    "\n",
    "<ul>\n",
    "\t<li>前十个字符是乘客的手机号码。</li>\n",
    "\t<li>接下来的一个字符是乘客的性别。</li>\n",
    "\t<li>接下来两个字符是乘客的年龄。</li>\n",
    "\t<li>最后两个字符是乘客的座位号。</li>\n",
    "</ul>\n",
    "\n",
    "<p>请你返回乘客中年龄 <strong>严格大于 60 岁</strong>&nbsp;的人数。</p>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>示例 1：</strong></p>\n",
    "\n",
    "<pre>\n",
    "<b>输入：</b>details = [\"7868190130M7522\",\"5303914400F9211\",\"9273338290F4010\"]\n",
    "<b>输出：</b>2\n",
    "<b>解释：</b>下标为 0 ，1 和 2 的乘客年龄分别为 75 ，92 和 40 。所以有 2 人年龄大于 60 岁。\n",
    "</pre>\n",
    "\n",
    "<p><strong>示例 2：</strong></p>\n",
    "\n",
    "<pre>\n",
    "<b>输入：</b>details = [\"1313579440F2036\",\"2921522980M5644\"]\n",
    "<b>输出：</b>0\n",
    "<b>解释：</b>没有乘客的年龄大于 60 岁。\n",
    "</pre>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>提示：</strong></p>\n",
    "\n",
    "<ul>\n",
    "\t<li><code>1 &lt;= details.length &lt;= 100</code></li>\n",
    "\t<li><code>details[i].length == 15</code></li>\n",
    "\t<li><code>details[i]</code>&nbsp;中的数字只包含&nbsp;<code>'0'</code>&nbsp;到&nbsp;<code>'9'</code>&nbsp;。</li>\n",
    "\t<li><code>details[i][10]</code>&nbsp;是 <code>'M'</code>&nbsp;，<code>'F'</code>&nbsp;或者&nbsp;<code>'O'</code>&nbsp;之一。</li>\n",
    "\t<li>所有乘客的手机号码和座位号互不相同。</li>\n",
    "</ul>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Description: [number-of-senior-citizens](https://leetcode.cn/problems/number-of-senior-citizens/description/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solutions: [number-of-senior-citizens](https://leetcode.cn/problems/number-of-senior-citizens/solutions/)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_cases = ['[\"7868190130M7522\",\"5303914400F9211\",\"9273338290F4010\"]', '[\"1313579440F2036\",\"2921522980M5644\"]']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        res = 0\n",
    "        for i in details:\n",
    "            if int(i[-4:-2]) > 60:\n",
    "                res += 1\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for x in details:\n",
    "            if int(x[-4:-2]) > 60:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for info in details if int(info[11:13]) > 60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        rt = 0\n",
    "        for s in details:\n",
    "            # 0:10 :phone\n",
    "            # 10:11 :sex\n",
    "            # 11:13 : age\n",
    "            age = s[11:13]\n",
    "            age_i = int(age)\n",
    "            if age_i>60:\n",
    "                rt+=1\n",
    "        return rt "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        a=[int(m[11:13]) for m in details]\n",
    "        num=0\n",
    "        for i in a:\n",
    "            if i>60:\n",
    "                num+=1\n",
    "        return num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        year_list = []\n",
    "        c = 0\n",
    "        for i in details:\n",
    "            year_list.append(int(''.join(list(i)[11:13])))\n",
    "        for s in year_list:\n",
    "            if s > 60:\n",
    "                c+=1\n",
    "        return c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return len([i for i in details if int(i[-4:-2]) > 60])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        total = 0\n",
    "        for i in range(len(details)):\n",
    "            if int(details[i][11:13]) > 60:\n",
    "                total += 1\n",
    "        return total\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for info in details if int(info[11:13]) > 60)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        res = 0\n",
    "        for c in details:\n",
    "            if int(c[11:13]) > 60:\n",
    "                res += 1\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        cnt = 0\n",
    "        for s in details:\n",
    "            if int(s[11: 13]) > 60:\n",
    "                cnt += 1\n",
    "        return cnt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return len([i for i in details if i[11:13] > '60'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        def getage(detail):\n",
    "            if int(''.join(detail[-4:-2]))>60:\n",
    "                return 1\n",
    "            return 0\n",
    "        return sum(map(getage,details))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        # count=0\n",
    "        # for detail in details:\n",
    "        #     if detail[11:13]>'60':\n",
    "        #         count+=1\n",
    "        # return count\n",
    "        return len([s for s in details if int(s[11:13]) > 60])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        res = 0\n",
    "        \n",
    "        for detail in details:\n",
    "            age = ''.join(list(detail)[-4: -2])\n",
    "\n",
    "            if int(age) > 60:\n",
    "                res += 1\n",
    "\n",
    "        return res\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        n = 0\n",
    "        for i in details:\n",
    "            if int(i[-4:-2]) > 60:\n",
    "                n += 1\n",
    "        return n "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for info in details if int(info[11:13]) > 60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(x[11:13]) > 60 for x in details)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return len(list(filter(lambda x: x == True, [detail[11:13] > '60' for detail in details])))\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        count=0\n",
    "        for detail in details:\n",
    "            if int(detail[11:13])>60:count+=1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for detail in details if detail[11:13]>'60')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans, age = 0, 0\n",
    "        for info in details:\n",
    "            age = int(info[11]) * 10 + int(info[12])\n",
    "            if age > 60:\n",
    "                ans += 1\n",
    "        return ans\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for i in details:\n",
    "            if int(i[-4:-2]) >60:\n",
    "                ans+=1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for i in details if int(i[11:13]) > 60)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        \n",
    "        ret = 0\n",
    "        for s in details:\n",
    "            if int(s[11:13]) > 60:\n",
    "                ret += 1\n",
    "        \n",
    "        return ret"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        a=len(details)\n",
    "        count=0\n",
    "        for i in range(0,a):\n",
    "            nums=[str(n) for n in details[i]]\n",
    "            b=int(nums[11])*10+int(nums[12])\n",
    "            if b>60:\n",
    "                count+=1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return len([s for s in details if int(s[11:13]) > 60])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        counts = 0\n",
    "        for i in details:\n",
    "            if i[11:13] >'60':\n",
    "                counts+=1\n",
    "        return counts\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for x in details:\n",
    "            if x[11:13] > '60':\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        # return sum(int(inf[-4:-2]) > 60 for inf in details)\n",
    "        n = 0\n",
    "        for inf in details:\n",
    "            num = int(inf[-4:-2])\n",
    "            n += 1 if num > 60 else 0\n",
    "        return n\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(x[11:13]) > 60 for x in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        count = 0\n",
    "        for i in details:\n",
    "            if int(i[-4])> 6:\n",
    "                count += 1\n",
    "            elif int(i[-4]) == 6 and int(i[-3]) != 0:\n",
    "                count += 1\n",
    "        return count\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        count = 0\n",
    "        for i in details:\n",
    "            if int(i[11:13]) > 60:\n",
    "                count += 1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        num=0\n",
    "        for i in range(0,len(details)):\n",
    "            age=int(details[i][11:13])\n",
    "            if age>60:\n",
    "                num+=1\n",
    "        return num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        cnt = 0\n",
    "        for detail in details:\n",
    "            age = int(detail[11 : 13])\n",
    "            if age > 60:\n",
    "                cnt += 1\n",
    "        return cnt\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(x[11:13])>60 for x in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        num = 0\n",
    "        for info in details:\n",
    "            if int(info[11:13]) > 60:\n",
    "                num += 1\n",
    "        return num\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        sum=0\n",
    "        for i in range(len(details)):\n",
    "           if int(details[i][11:13])>60:\n",
    "              sum+=1\n",
    "        return sum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        res = 0\n",
    "        for p in details:\n",
    "            age = int(p[11: 13])\n",
    "            if age > 60:\n",
    "                res += 1\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for s in details:\n",
    "            if int(s[11:13])>60:\n",
    "                ans+=1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        count = 0\n",
    "        for data in details:\n",
    "            if int(data[11:13]) > 60:\n",
    "                count += 1\n",
    "        return count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        elder = 0\n",
    "        for dtal in details:\n",
    "            age = int(dtal[11:13])\n",
    "            if age > 60:\n",
    "                elder += 1\n",
    "        return elder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        resultList = [i for i in details if int(i[-4:-2]) > 60]\n",
    "        return len(resultList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        a = [int(i[11:13]) for i in details]\n",
    "        return len(list(filter(lambda x: x>60, a)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        res = 0\n",
    "        for detail in details:\n",
    "            age = int(detail[11:13])\n",
    "            if age > 60:\n",
    "                res += 1\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        cnt = 0\n",
    "        for info in details:\n",
    "            if int(info[-4:-2]) > 60:\n",
    "                cnt += 1\n",
    "        return cnt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for info in details if int(info[11:13]) > 60)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for d in details:\n",
    "            if int(d[11:13]) > 60:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        n = len(details)\n",
    "        res = 0\n",
    "        for i in range(n):\n",
    "            ans = int(details[i][11:13])\n",
    "            if ans > 60:\n",
    "                res += 1\n",
    "        return res \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        a=0\n",
    "        for i in details:\n",
    "            if int(i[11:13])>60:\n",
    "                a+=1\n",
    "        return a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for item in details if int(item[-4:-2]) > 60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(d[11:13]) > 60 for d in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for info in details if int(info[11:13]) > 60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return(sum([int(i[11:13])>60 for i in details]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        sum=0\n",
    "        for i in details:\n",
    "            n=int(i[-4])*10+int(i[-3])\n",
    "            if n>60:\n",
    "                sum+=1\n",
    "        return sum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(1 for detail in details if int(detail[11]+detail[12]) > 60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        steps = 0\n",
    "        for i in details:\n",
    "            if int(i[11:13]) > 60:\n",
    "                steps += 1\n",
    "        return steps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for d in details:\n",
    "            age = d[11:13]\n",
    "            if int(age) > 60:\n",
    "                ans += 1\n",
    "            \n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(x[11:13]) > 60 for x in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        res = 0\n",
    "        for i in details:\n",
    "            if i[11:13]>'60':\n",
    "                res += 1\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for ss in details:\n",
    "            tmp = ss[-4] + ss[-3]\n",
    "            if int(tmp) > 60:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "# from typing import List\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details):\n",
    "        return sum(((ord(d[11]) - ord('0')) * 10 + (ord(d[12]) - ord('0')) > 60) for d in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for k in details:\n",
    "            if int(k[11:13]) > 60:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ages = [int(detail[11:13]) for detail in details]\n",
    "        senior_count = sum(age > 60 for age in ages)\n",
    "        return senior_count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        result=0\n",
    "        for info in details:\n",
    "            n=info[11:13]\n",
    "            if int(n)>60:\n",
    "                result+=1\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(x[11:13]) > 60 for x in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(str[11: 13] > '60' for str in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        n=len(details)\n",
    "        b=0\n",
    "        for i in range (n):\n",
    "            a=details[i]\n",
    "            c=int(a[11])\n",
    "            d=int(a[12])\n",
    "            e=c*10+d\n",
    "            if (e>60):\n",
    "                b+=1\n",
    "            else:\n",
    "                b+=0\n",
    "        return b\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for s in details:\n",
    "            if int(s[11:13]) > 60:\n",
    "                ans += 1\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return sum(int(s[-4:-2]) > 60 for s in details)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        ans = 0\n",
    "        for num in details:\n",
    "            ans += 1 if int(num[11:13]) > 60 else 0\n",
    "\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        resNum = 0\n",
    "        for ticket in details:\n",
    "            age = int(ticket[11:13])\n",
    "            if age > 60:\n",
    "                resNum += 1\n",
    "\n",
    "        return resNum\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        return len([s for s in details if int(s[11:13]) > 60])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def countSeniors(self, details: List[str]) -> int:\n",
    "        a=0\n",
    "\n",
    "        for i in details:\n",
    "            if int(i[11:13])>60:\n",
    "                a+=1\n",
    "        return a\n",
    "        "
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 2
}
